package com.techie.mdm.appbar.showcase.binding;

import org.springframework.binding.value.ValueChangeDetector;
import org.springframework.binding.value.support.DefaultValueChangeDetector;
import org.springframework.richclient.application.ApplicationServices;
import org.springframework.richclient.application.ApplicationServicesLocator;

/**
 * ValueHolder is dependent upon ApplicationServices.
 * Makes testing a pain...
 */
public class ValueModelApplicationServices implements ApplicationServices    
{
    public Object getService(Class serviceType)
    {
        return new DefaultValueChangeDetector();
    }

    public boolean containsService(Class serviceType)
    {
        return ValueChangeDetector.class.equals(serviceType);
    }


    static public void load()
    {
        ApplicationServices services = new ValueModelApplicationServices();
        ApplicationServicesLocator.load(new ApplicationServicesLocator(services));
    }

}
